<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<title>面料管理</title>
</head>
<body>
<nav class="breadcrumb">
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20">
	<div id="search" class="text-c"> 
		<label>面料名称:</label><input type="text" class="input-text" style="width:250px" placeholder="输入面料名称" id="F_NAME" name="F_NAME" value="">
		<label>面料编号:</label><input type="text" class="input-text" style="width:250px" placeholder="输入面料编号" id="F_NO" name="F_NO" value="">
		<label>面料类别:</label>
		<span class="select-box" style="width:150px;">
			<select id="F_TYPE" name="F_TYPE" class="select">
	   			<option value="">请选择</option>
	   			<option value="1">面料目录</option>
	   			<option value="2">版布开发</option>
	   			<option value="3">开发样本</option>
			</select>
		</span>
		<button type="submit" class="btn btn-success radius" name="" onclick="searchMethod('#FabricTable')" ><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="l">
			<a href="javascript:;" onclick="member_del('../fabric/delete')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a> 
			<a href="javascript:;" onclick="fabric_add()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a>
			<a href="javascript:;" onclick="fabric_edit()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe6df;</i> 修改</a>
		</span>
	</div>
	<div class="mt-20">
	<table id="FabricTable" class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th data-field="F_ID">ID</th>
				<th data-field="F_IMG" data-formatter="imgFormatter">面料图片</th>
                <th data-field="F_NAME">名称（中文）</th>
                <th data-field="fType">类型</th>
                <th data-field="F_NO">编号</th>
                <th data-field="F_PRICE">价格（元/米）</th>
                <th data-field="fState">货源</th>
                <th data-field="F_ORIGIN">生产地（中文）</th>
                <th data-field="F_G_PROPERTY">克重</th>
                <th data-field="F_SALES">累计销售/米</th>
                <th data-field="F_CREATE_TIME" data-formatter="dateFormatter">添加时间</th>
			</tr>
		</thead>
	</table>
	</div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/laypage/1.2/laypage.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/moment.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/tableAddData.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/jqthumb/jqthumb.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/tableBtnGroup.js"></script>
<script type="text/javascript">
function fabric_add(){
	var url="${pageContext.request.contextPath }/admin/fabric/toAddPage";
	var index = layer.open({
		type: 2,
		title: "添加",
		content: url
	});
	layer.full(index);
}
function fabric_edit(){
	var checkboxes=$('table tbody tr').find('input[type="checkbox"]');
	var tr_num = null;
	var checkboxVal='';
	checkboxes.each(function(){
		if($(this).prop('checked')==true){
			tr_num++;
			checkboxVal=$(this).val();
		}
	});
	if(tr_num==null){
		layer.msg('请选择要修改的数据！',{icon:0,time:1000});
	}else if(tr_num==1){
		var url="${pageContext.request.contextPath }/admin/fabric/toUpdatePage?id="+checkboxVal;
		var index = layer.open({
			type: 2,
			title: "修改",
			content: url
		});
		layer.full(index);
	}else{
		layer.msg('请选择一条数据！',{icon:0,time:1000},function(){
			return null;
		});
	}
}
</script>
</body>
</html>